package qc.module.demo.api.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import qc.module.demo.dto.clazz.ClassDto;
import qc.module.demo.service.ClassService;

import java.util.List;

@Api(tags = "班级-Class")
@RestController
@RequestMapping("/class")
public class ClassController {
    private ClassService classService;

    @Autowired
    public void setClassService(ClassService classService) {
        this.classService = classService;
    }

    /**
     * 获取所有班级信息
     *
     * @return 班级信息集合
     */
    @ApiOperation("获取所有班级-all")
    @GetMapping("/all")
    public List<ClassDto> getAll() {
        return classService.getAll();
    }
}
